home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / Disks.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  3.7 KB  |  168 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        Disks.h
  3.  
  4.      Contains:    Disk Driver Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1985-1991,1993, 1995-1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __DISKS__
  18. #define __DISKS__
  19.  
  20. #ifndef __MACTYPES__
  21.     #include <MacTypes.h>
  22. #endif
  23.  
  24. #ifndef __OSUTILS__
  25.     #include <OSUtils.h>
  26. #endif
  27.  
  28.  
  29.  
  30.  
  31. #if PRAGMA_ONCE
  32. #pragma once
  33. #endif
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39. #if PRAGMA_IMPORT
  40. #pragma import on
  41. #endif
  42.  
  43. #if PRAGMA_STRUCT_ALIGN
  44.     #pragma options align=mac68k
  45. #elif PRAGMA_STRUCT_PACKPUSH
  46.     #pragma pack(push, 2)
  47. #elif PRAGMA_STRUCT_PACK
  48.     #pragma pack(2)
  49. #endif
  50.  
  51. enum {
  52.     sony                        = 0,
  53.     hard20                        = 1
  54. };
  55.  
  56. /* Disk Driver Status csCodes */
  57. enum {
  58.     kReturnFormatList            = 6,                            /* .Sony */
  59.     kDriveStatus                = 8,
  60.     kMFMStatus                    = 10
  61. };
  62.  
  63. /* Disk Driver Control csCodes */
  64. enum {
  65.     kVerify                        = 5,
  66.     kFormat                        = 6,
  67.     kEject                        = 7,
  68.     kSetTagBuffer                = 8,                            /* .Sony */
  69.     kTrackCache                    = 9,                            /* .Sony */
  70.     kDriveIcon                    = 21,
  71.     kMediaIcon                    = 22,
  72.     kDriveInfo                    = 23,
  73.     kRawTrack                    = 18244                            /* .Sony: "diagnostic" raw track dump */
  74. };
  75.  
  76. /*
  77.     Note:
  78.  
  79.     qLink is usually the first field in queues, but back in the MacPlus
  80.     days, the DrvSts record needed to be expanded.  In order to do this without
  81.     breaking disk drivers that already added stuff to the end, the fields
  82.     where added to the beginning.  This was originally done in assembly language
  83.     and the record was defined to start at a negative offset, so that the qLink
  84.     field would end up at offset zero.  When the C and pascal interfaces where
  85.     made, they could not support negative record offsets, so qLink was no longer
  86.     the first field.  Universal Interfaces are auto generated and don't support
  87.     negative offsets for any language, so DrvSts in Disks.a has qLinks at a
  88.     none zero offset.  Assembly code which switches to Universal Interfaces will
  89.     need to compensate for that.
  90.  
  91. */
  92.  
  93.  
  94. struct DrvSts {
  95.     short                             track;                        /* current track */
  96.     char                             writeProt;                    /* bit 7 = 1 if volume is locked */
  97.     char                             diskInPlace;                /* disk in drive */
  98.     char                             installed;                    /* drive installed */
  99.     char                             sides;                        /* -1 for 2-sided, 0 for 1-sided */
  100.     QElemPtr                         qLink;                        /* next queue entry */
  101.     short                             qType;                        /* 1 for HD20 */
  102.     short                             dQDrive;                    /* drive number */
  103.     short                             dQRefNum;                    /* driver reference number */
  104.     short                             dQFSID;                        /* file system ID */
  105.     char                             twoSideFmt;                    /* after 1st rd/wrt: 0=1 side, -1=2 side */
  106.     char                             needsFlush;                    /* -1 for MacPlus drive */
  107.     short                             diskErrs;                    /* soft error count */
  108. };
  109. typedef struct DrvSts                    DrvSts;
  110.  
  111. struct DrvSts2 {
  112.     short                             track;
  113.     char                             writeProt;
  114.     char                             diskInPlace;
  115.     char                             installed;
  116.     char                             sides;
  117.     QElemPtr                         qLink;
  118.     short                             qType;
  119.     short                             dQDrive;
  120.     short                             dQRefNum;
  121.     short                             dQFSID;
  122.     short                             driveSize;
  123.     short                             driveS1;
  124.     short                             driveType;
  125.     short                             driveManf;
  126.     short                             driveChar;
  127.     char                             driveMisc;
  128. };
  129. typedef struct DrvSts2                    DrvSts2;
  130. enum {
  131.     kdqManualEjectBit            = 5
  132. };
  133.  
  134. #if CALL_NOT_IN_CARBON
  135. EXTERN_API( OSErr )
  136. DiskEject                        (short                     drvNum);
  137.  
  138. EXTERN_API( OSErr )
  139. SetTagBuffer                    (void *                    buffPtr);
  140.  
  141. EXTERN_API( OSErr )
  142. DriveStatus                        (short                     drvNum,
  143.                                  DrvSts *                status);
  144.  
  145. #endif  /* CALL_NOT_IN_CARBON */
  146.  
  147.  
  148. #if PRAGMA_STRUCT_ALIGN
  149.     #pragma options align=reset
  150. #elif PRAGMA_STRUCT_PACKPUSH
  151.     #pragma pack(pop)
  152. #elif PRAGMA_STRUCT_PACK
  153.     #pragma pack()
  154. #endif
  155.  
  156. #ifdef PRAGMA_IMPORT_OFF
  157. #pragma import off
  158. #elif PRAGMA_IMPORT
  159. #pragma import reset
  160. #endif
  161.  
  162. #ifdef __cplusplus
  163. }
  164. #endif
  165.  
  166. #endif /* __DISKS__ */
  167.  
  168.